import request from '@/utils/request.js'
import upload from '@/utils/upload.js'
export const getBrandsList = data => {
  return request({
    method: 'post',
    url: 'api/Commodity/PagingBrand',
    data
  })
}

export const getGoodsList = data => {
  return request({
    method: 'post',
    url: 'api/Commodity/PagingGoods',
    data
  })
}

export const getcatoryList = data => {
  return request({
    method: 'post',
    url: 'api/Commodity/LoadCategory',
    data
  })
}

export const getalltype = data => {
  return request({
    method: 'post',
    url: 'api/Commodity/GoodsCaterogy',
    data
  })
}

export const disablePro = data => {
  return request({
    method: 'post',
    url: 'api/Commodity/GoodsDisable',
    data
  })
}

export const enablePro = data => {
  return request({
    method: 'post',
    url: 'api/Commodity/GoodsEnable',
    data
  })
}

export const getProDetailList = data => {
  return request({
    method: 'post',
    url: 'api/Commodity/LoadGoods',
    data
  })
}

export const getAllBrands = data => {
  return request({
    method: 'post',
    url: 'api/Commodity/PagingBrand',
    data
  })
}

export const editProDetil = data => {
  return request({
    method: 'post',
    url: 'api/Commodity/UpdateGoods',
    data
  })
}

export const addGoods = data => {
  return request({
    method: 'post',
    url: 'api/Commodity/AddGoods',
    data
  })
}

export const getCatoryList = data => {
  return request({
    method: 'post',
    url: 'api/Commodity/PagingCategory',
    data
  })
}

export const getCatoryTree = data => {
  return request({
    method: 'post',
    url: 'api/Commodity/BuildTree',
    data
  })
}

export const editCatory = data => {
  return request({
    method: 'post',
    url: 'api/Commodity/UpdateCategory',
    data
  })
}

export const addCatory = data => {
  return request({
    method: 'post',
    url: 'api/Commodity/AddCategory',
    data
  })
}

export const editBrand = data => {
  return request({
    method: 'post',
    url: 'api/Commodity/UpdateBrand',
    data
  })
}

export const deleBrand = data => {
  return request({
    method: 'post',
    url: 'api/Commodity/DeleteOneBrand',
    data
  })
}

export const addBrand = data => {
  return request({
    method: 'post',
    url: 'api/Commodity/AddBrand',
    data
  })
}

export const uploadPic = data => {
  return upload({
    method: 'post',
    url: 'api/File/Upload',
    data,
    headers: { 'Content-Type': 'multipart/form-data' }
  })
}

export const getGoodsDanpin = data => {
  return request({
    method: 'post',
    url: 'api/Commodity/GoodsDanpin',
    data
  })
}

export const getGoodsGift = data => {
  return request({
    method: 'post',
    url: 'api/Commodity/GoodsGift',
    data
  })
}

export const getWarehouseList = data => {
  return request({
    method: 'post',
    url: 'api/Commodity/WarehouseList',
    data
  })
}

export const getBrandInfo = data => {
  return request({
    method: 'post',
    url: 'api/Commodity/BrandInfo',
    data
  })
}

export const getAllBrand = data => {
  return request({
    method: 'post',
    url: 'api/Commodity/LoadBrand',
    data
  })
}

export const getCatoryInfo = data => {
  return request({
    method: 'post',
    url: 'api/Commodity/CategoryInfo',
    data
  })
}
